export default {
  namespaced: true,
  state() {
    return {
      goods: [
        { name: "商品1", price: 9999 },
        { name: "商品2", price: 999.9 },
        { name: "商品3", price: 99.99 },
        { name: "商品4", price: 9.999 },
      ],
    };
  },
  getters: {
    filterGoods(state) {
      let list = state.goods.filter((item) => item.price < 100);
      return list;
    },
  },
  mutations: {
    goodsAddMut(state, goodsObj) {
      state.goods.push(goodsObj);
    },
  },
};
